Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow reusing call instances after leaving #1433

Merged
merged 4 commits into from
Jul 24, 2024
Merged

Conversation

myandrienko
Copy link
Contributor

No description provided.


this.dispatcher.offAll();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍓 Not removing listeners from dispatcher.

That seems to be safe, since every object keeping a reference to a dispatcher (except for the call itself) is nullified on leave. So the call instance will be GC-ed properly even without offAll.

this.camera = new CameraManager(this);
this.microphone = new MicrophoneManager(this);
this.speaker = new SpeakerManager(this);
this.screenShare = new ScreenShareManager(this);
}

private async setup() {
await withoutConcurrency(this.joinLeaveConcurrencyTag, async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prevents a race condition with leave. It's important to wait for leave to finish before we set everything back up again. See the test case here: https://github.com/GetStream/stream-video-js/pull/1433/files#diff-912706ed8d680e55d746f9765aa5090d64771196a9894262bed3e0b73d9a8c97R92-R110

@oliverlaz oliverlaz requested a review from szuperaz July 4, 2024 16:36
@myandrienko myandrienko merged commit 61e05af into main Jul 24, 2024
21 checks passed
myandrienko added a commit that referenced this pull request Jul 25, 2024
🚂 #1433 

Removes a guard preventing joining left calls.
@oliverlaz oliverlaz deleted the fix/reusable-call branch August 30, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants